1. Field of the Invention
The present invention relates to an encoding apparatus, an encoding method, and a computer product for encoding an image by inserting an intra-refresh area into a portion of the image periodically based on an intra-refresh period.
2. Description of the Related Art
In a conventional picture transfer system including an encoding apparatus for displaying a video shot by a camera on a monitor in real time as shown in FIG. 12, a monitor frame is split into a plurality of pictures, and an intra-refresh area is inserted into each picture as shown in FIG. 13, to shorten a time interval (a delay time) from the instant each picture is shot by the camera to the instant the picture is displayed on the monitor.
In case an intra-refresh area is not inserted into a picture because of an overrun of a processing time due to a lack of a processing capacity of the picture transfer system or an overflow of a buffer due to an excess of an amount of generated information, the picture without the intra-refresh area inserted fails to be refreshed. To solve the problem, various technologies for eliminating a leak of the intra-refresh area have been developed.
For example, a technology is disclosed in Japanese Patent Application Laid-open No. 2003-87800, in which an intra-refresh width according to a picture or a frame is manually changed following an instruction from an external device or the like.
Furthermore, according to a technology disclosed in Japanese Patent Application Laid-open No. 2001-359102, an intra-refresh area is determined based on a map of previously-refreshed areas, a generated bit amount, or the like, when performing an intra-refresh.
However, in the technology disclosed in Japanese Patent Application Laid-open No. 2003-87800, when encoded data of a picture cannot be transmitted properly due to an overrun of a processing time or an amount of information and the picture is replaced with a picture having a smaller bit amount or a skip picture prepared in advance, as an alternative picture, the intra-refresh cannot be performed or an intra-refresh period varies, which results in a degradation of an image quality or a refresh performance of the entire frame.
Specifically, in a case shown in FIG. 14, an intra-refresh area supposed to be inserted into the picture replaced with the alternative picture is inserted into a subsequent picture after the alternative picture, so that the intra-refresh period is changed from a six-picture period to a seven-picture period. In a case shown in FIG. 15, an intra-refresh area supposed to be inserted into the picture replaced with the alternative picture is skipped, so that an area where the intra-refresh area is not inserted is not refreshed, although the intra-refresh period is not changed, which results in the same problem.
Furthermore, in the technology disclosed in Japanese Patent Application Laid-open No. 2001-359102, because an intra-refresh area is fixed based on previous information, when a picture having a high encoding difficulty or a large amount of information is encoded, a coding efficiency and an image quality of the picture are degraded.
Specifically, to achieve a low-delay picture transfer system, it is preferable to minimize a receiving-side buffer by maintaining an amount of generated information per picture constant to smooth amounts of generated information as shown in FIG. 16. However, it is necessary to limit an amount of generated information to be stored in the receiving-side buffer even if a picture to be encoded has a high encoding difficulty due to a complicated design. In this case, a quantized value of the picture is increased to reduce the amount of generated information. However, if the quantized value varies by each scene, the picture also fluctuates. Consequently, in the case where a picture having a high encoding difficulty or a large amount of information is encoded, if an intra-refresh area is fixed based on previous information, a coding efficiency and an image quality of the picture are degraded.
In this manner, according to the conventional technologies, an intra-refresh area is fixed by an instruction from an external source or based on previous information, so that when a picture is encoded, an intra-refresh area or an intra-refresh period cannot be appropriately changed depending on an input signal (such as a picture). Thus, a coding efficiency and an image quality of the picture are degraded.